package com.ruoyi.commoditytype.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.commoditytype.mapper.SysCommodityTypeMapper;
import com.ruoyi.commoditytype.domain.SysCommodityType;
import com.ruoyi.commoditytype.service.ISysCommodityTypeService;

/**
 * 商品分类Service业务层处理
 * 
 * @author zzx
 * @date 2022-06-07
 */
@Service
public class SysCommodityTypeServiceImpl implements ISysCommodityTypeService 
{
    @Autowired
    private SysCommodityTypeMapper sysCommodityTypeMapper;

    /**
     * 查询商品分类
     * 
     * @param commodityTypeId 商品分类主键
     * @return 商品分类
     */
    @Override
    public SysCommodityType selectSysCommodityTypeByCommodityTypeId(Long commodityTypeId)
    {
        return sysCommodityTypeMapper.selectSysCommodityTypeByCommodityTypeId(commodityTypeId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param sysCommodityType 商品分类
     * @return 商品分类
     */
    @Override
    public List<SysCommodityType> selectSysCommodityTypeList(SysCommodityType sysCommodityType)
    {
        return sysCommodityTypeMapper.selectSysCommodityTypeList(sysCommodityType);
    }

    /**
     * 新增商品分类
     * 
     * @param sysCommodityType 商品分类
     * @return 结果
     */
    @Override
    public int insertSysCommodityType(SysCommodityType sysCommodityType)
    {
        return sysCommodityTypeMapper.insertSysCommodityType(sysCommodityType);
    }

    /**
     * 修改商品分类
     * 
     * @param sysCommodityType 商品分类
     * @return 结果
     */
    @Override
    public int updateSysCommodityType(SysCommodityType sysCommodityType)
    {
        return sysCommodityTypeMapper.updateSysCommodityType(sysCommodityType);
    }

    /**
     * 批量删除商品分类
     * 
     * @param commodityTypeIds 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityTypeByCommodityTypeIds(Long[] commodityTypeIds)
    {
        return sysCommodityTypeMapper.deleteSysCommodityTypeByCommodityTypeIds(commodityTypeIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param commodityTypeId 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityTypeByCommodityTypeId(Long commodityTypeId)
    {
        return sysCommodityTypeMapper.deleteSysCommodityTypeByCommodityTypeId(commodityTypeId);
    }
}
